import os


def root_write(dir_name, file_name, content):
    folder_path = os.path.join(os.getcwd(), dir_name)
    if not os.path.exists(folder_path):
        os.makedirs(folder_path)
    file_path = os.path.join(folder_path, file_name)
    with open(file_path, 'w', encoding='utf-8') as file:
        file.write(content)
    print(f"写入成功: {file_path}")


def root_read(dir_name, file_name):
    folder_path = os.path.join(os.getcwd(), dir_name)
    file_path = os.path.join(folder_path, file_name)
    if not os.path.exists(file_path):
        return None
    with open(file_path, 'r', encoding='utf-8') as file:
        content = file.read()
    return content
